﻿using System;
using System.Xml;
using Autodesk.Revit.DB;
using YArchitech.HCLoad.Utils;

namespace YArchitech.HCLoad.Export
{
	public class HcXmlOpening : HcXmlElement
	{
		public HcXmlOpening(FamilyInstance f)
		{
			this.m_familyInstance = f;
		}

		public override bool WriteElementData(ref XmlElement xmlelem_Opening)
		{
			if (!base.WriteElementData(ref xmlelem_Opening))
			{
				return false;
			}
			xmlelem_Opening.SetAttribute("id", this.m_familyInstance.Id.ToString());
			xmlelem_Opening.SetAttribute("openingType", HcUtils.GetObjectTypeString(this.m_familyInstance));
			HcXmlElement.AppendTextElement(ref xmlelem_Opening, "Name", this.m_familyInstance.Name);
			return true;
		}

		private FamilyInstance m_familyInstance;
	}
}
